<template>
  <div class="hotMovies">
    <div class="listContent">
      <div class="item" v-for="item of hotMovies" :key="item._id">
        <img :src="item.pic" alt="" @click="goDetail(item._id)" />
        <p>{{ item.title }}</p>
        <div>
            <span>{{item.raiting}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      hotMovies: [],
    };
  },
  mounted() {
    this.$http(`http://122.112.161.135:4000/api/movie/inTheaters`).then((res) => {
      this.hotMovies = res.data.res.map(item=>{
          item.rating = item.raiting;
          return item
      });
    });
  },
};
</script>

<style scoped>
.listContent {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.3rem;
}
.listContent .item {
  width: 2.8rem;
  margin-bottom: 0.3rem;
}
.listContent .item img {
  width: 100%;
  height: 4rem;
  margin-bottom: 0.2rem;
}
.h-left{
    display: flex;
    align-items: center;
}
.h-left img{
    margin-right: 0.2rem;
}
</style>